# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-emailprotectionslib
pkgname=('python2-emailprotectionslib' 'python-emailprotectionslib')
_pkgname=emailprotectionslib
pkgver=0.8.3
pkgrel=9
pkgdesc='Python library to interact with SPF and DMARC.'
arch=('any')
url='https://pypi.python.org/pypi/emailprotectionslib/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/4e/0e/3e1eccf63c9b6307ee2b4d81a01aa51369891bfb966d6063da11cad81147/$_pkgname-$pkgver.tar.gz")
sha512sums=('529523a1af1d5a803133d69a31cb14a339477b6e1418bf40a3733b0a8b5f08bf707236101852dd3cd79bf6d427e567f953fc6050eba0cf05c18c3efbe4984fd3')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-emailprotectionslib() {
  depends=('python2' 'python2-dnslib' 'python2-tldextract')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-emailprotectionslib() {
  depends=('python' 'python-dnslib' 'python-tldextract')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

